import {
	request
} from './unit.js'
const login = (data) => {
	request({
		url: '/inspection/login',
		method: 'POST',
		data
	}).then(res => {
		if (res.data.code == 0) {
			uni.navigateTo({
				url: '/pages/index/index'
			})
		} 
	})
}


const bicycleList = (data) => {
	return request({
		url: '/inspection/bicycle/list',
		method: 'POST',
		data
	}).then(res => {
		if (res.data.code == 0) {
			return res.data.data;
		} 
	})
}
const sendTask= (data) => {
	 request({
		url: '/inspection/bicycle/send-task',
		method: 'POST',
		data
	}).then(res => {
		if (res.data.code == 0) {
			console.log(res.data.data)
		} 
	})
}

const out= (data) => {
	 request({
		url: '/inspection/auth/logout',
		data
	}).then(res => {
		console.log(res)
		uni.navigateTo({
			url:'/pages/login/login'
		})
	})
}

export {
	login,
	bicycleList,
	sendTask,
	out
}
